package io.kerns.core.web.response;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

public class Response<T> implements Serializable {
    private static final long serialVersionUID = 5682197105040852221L;
    @ApiModelProperty(
        value = "成功",
        required = true,
        position = 10
    )
    private boolean success;
    @ApiModelProperty(
        value = "状态码：200, 成功\n1, 参数异常\n2, 系统异常\n3, 发现bug\n4, 业务检查不通过\n5, 无数据\n6, 登录状态异常\n",
        required = true,
        position = 20
    )
    private String code;
    @ApiModelProperty(
        value = "错误信息",
        required = true,
        position = 40
    )
    private String message;
    private T data;

    public Response() {
        this.success = true;
        this.code = "200";
    }


    public boolean isSuccess() {
        return this.success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return this.data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
